﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.Platform.DataContract;
using System.Xml;
using System.Web;
using CommonsLib.Settings;
using MaxLeaf.Platform.Contract;

namespace MaxLeaf.Platform.BLLProxy
{
    public abstract class BaseBLLProxy 
    {
        
        protected int Access_Mode
        {
            get
            {
                return GetClient().AccessMode;
            }

        }

        private WCFClientInfo GetClient()
        {
            return MaxLeaf.Platform.Settings.ConfigFunc.GetBLLProxyInfo(GetBLLProxyName());
        }

        private string GetBLLProxyName()
        {
            string strName = this.GetType().Name;
            if (this.GetType().FullName.StartsWith("Castle."))
            {
                return strName.Replace("ProxyProxy", "Proxy");
            }
            else
            {
                return strName;
            }
        }

        protected List<WCFConfigInfo> WCF_Configs
        {
            get
            {
                return GetClient().WCF;
            }

        }

         
    }
}
